tests/pixbuf-lowmem.c tests/pixbuf-random.c
authorBjörn Lindqvist <bjourne@gmail.com>
Sun, 25 May 2008 08:41:15 +0000 (08:41 +0000)
committerBjörn Lindqvist <bjornl@src.gnome.org>
Sun, 25 May 2008 08:41:15 +0000 (08:41 +0000)
2008-05-25  Björn Lindqvist  <bjourne@gmail.com>

* tests/pixbuf-lowmem.c
* tests/pixbuf-random.c
* tests/pixbuf-randomly-modified.c
* tests/pixbuf-read.c
* tests/pixbuf-threads.c
* tests/testgtk.c
* tests/testtreeview.c: Fix remaining compiler warnings in these
files (#523751).

svn path=/trunk/; revision=20144

ChangeLog
tests/pixbuf-lowmem.c
tests/pixbuf-random.c
tests/pixbuf-randomly-modified.c
tests/pixbuf-read.c
tests/pixbuf-threads.c
tests/testgtk.c
tests/testtreeview.c

index 69387299eb987cc1a76e4679f4be8dff53d2277e..d496206f156e71f28d628f4cdb874135c89c0f56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-05-25  Björn Lindqvist  <bjourne@gmail.com>
+
+       * tests/pixbuf-lowmem.c
+       * tests/pixbuf-random.c
+       * tests/pixbuf-randomly-modified.c
+       * tests/pixbuf-read.c
+       * tests/pixbuf-threads.c
+       * tests/testgtk.c
+       * tests/testtreeview.c: Fix remaining compiler warnings in these
+       files (#523751).
+
 2008-05-25  Jaap A. Haitsma  <jaap@haitsma.org>
 
        reviewed by: Matthias Clasen
index f7245ba88b4997bb9b3f2b9f190e8202229fe761..305ce9aaf27cd152c6c957fa35ffb0f9ac7f9934 100644 (file)
@@ -133,7 +133,7 @@ static GMemVTable limited_table = {
 };
 
 static void
-mem_test (const guchar *bytes, gsize len)
+mem_test (const gchar *bytes, gsize len)
 {
   gboolean did_fail = FALSE;
   GError *err = NULL;
@@ -143,7 +143,7 @@ mem_test (const guchar *bytes, gsize len)
   
   do {
     loader = gdk_pixbuf_loader_new ();
-    gdk_pixbuf_loader_write (loader, bytes, len, &err);
+    gdk_pixbuf_loader_write (loader, (guchar *) bytes, len, &err);
     if (err)
       {
        g_error_free (err);
index df50ef3ca30ab75174ae7e181c82c0a7a4fb499a..f9ff9f5afe56e8af30953b674e553426c7562476 100644 (file)
@@ -26,7 +26,7 @@
 #include <string.h>
 
 static void
-assault (const gchar *header, gsize header_size, int n_images)
+assault (const guchar *header, gsize header_size, int n_images)
 {
   FILE *f;
   enum { N_CHARACTERS = 10000 };
index 3a33e0a302edffd104e0d88e74f9888c7bec18d4..7a31f0a5f6838a237ca8abe42209f31fec98f80f 100644 (file)
@@ -34,7 +34,7 @@ disaster (const char *what)
 }
 
 static void
-randomly_modify (const guchar *image, guint size)
+randomly_modify (const gchar *image, guint size)
 {
   int i;
 
index 44769632f075f6d399e8f31e083922cc22f907c5..17ece3fa52e38cbd14142321271790a6c2f5ed76 100644 (file)
@@ -74,7 +74,7 @@ main (int argc, char **argv)
        {
          err = NULL;
 
-         if (test_loader (contents, size, &err))
+         if (test_loader ((guchar *) contents, size, &err))
            g_print ("success\n");
          else
            g_print ("error: %s\n", err->message);
index 5a8ce5f6225a0b55a2f70fb0b7b4434e65dcd698..b8aeddd9b41db7f5d495c593c23ea7257b89c572 100644 (file)
@@ -33,7 +33,7 @@ load_image (gpointer  data,
   gchar *filename = data;
   FILE *file;
   int nbytes;
-  char buf[1024];
+  guchar buf[1024];
   size_t bufsize = 1024;
   GdkPixbufLoader *loader;
   GError *error = NULL;
index 7b89acff75f6adcc00bff5fba003381e89529bcb..ae0700b006b8cf8e5b0d13586a3768fca323c88d 100644 (file)
@@ -6761,15 +6761,8 @@ insert_row_clist (GtkWidget *widget, gpointer data)
 
   if (!style1)
     {
-      GdkColor col1 = { 0, };
-      GdkColor col2 = { 0, };
-
-      col1.red   = 0;
-      col1.green = 56000;
-      col1.blue  = 0;
-      col2.red   = 32000;
-      col2.green = 0;
-      col2.blue  = 56000;
+      GdkColor col1 = { 0, 0, 56000, 0};
+      GdkColor col2 = { 0, 32000, 0, 56000};
 
       style1 = gtk_style_copy (GTK_WIDGET (data)->style);
       style1->base[GTK_STATE_NORMAL] = col1;
@@ -6887,8 +6880,8 @@ create_clist (GtkWidget *widget)
   GtkWidget *label;
 
   GtkStyle *style;
-  GdkColor col1 = { 0, };
-  GdkColor col2 = { 0, };
+  GdkColor red_col = { 0, 56000, 0, 0};
+  GdkColor light_green_col = { 0, 0, 56000, 32000};
 
   if (!window)
     {
@@ -7019,16 +7012,9 @@ create_clist (GtkWidget *widget)
       sprintf (text[1], "Right");
       sprintf (text[2], "Center");
 
-      col1.red   = 56000;
-      col1.green = 0;
-      col1.blue  = 0;
-      col2.red   = 0;
-      col2.green = 56000;
-      col2.blue  = 32000;
-
       style = gtk_style_new ();
-      style->fg[GTK_STATE_NORMAL] = col1;
-      style->base[GTK_STATE_NORMAL] = col2;
+      style->fg[GTK_STATE_NORMAL] = red_col;
+      style->base[GTK_STATE_NORMAL] = light_green_col;
 
       pango_font_description_set_size (style->font_desc, 14 * PANGO_SCALE);
       pango_font_description_set_weight (style->font_desc, PANGO_WEIGHT_BOLD);
@@ -7204,8 +7190,8 @@ void change_style (GtkWidget *widget, GtkCTree *ctree)
   static GtkStyle *style2 = NULL;
 
   GtkCTreeNode *node;
-  GdkColor col1 = { 0, };
-  GdkColor col2 = { 0, };
+  GdkColor green_col = { 0, 0, 56000, 0};
+  GdkColor purple_col = { 0, 32000, 0, 56000};
 
   if (GTK_CLIST (ctree)->focus_row >= 0)
     node = GTK_CTREE_NODE
@@ -7218,21 +7204,14 @@ void change_style (GtkWidget *widget, GtkCTree *ctree)
 
   if (!style1)
     {
-      col1.red   = 0;
-      col1.green = 56000;
-      col1.blue  = 0;
-      col2.red   = 32000;
-      col2.green = 0;
-      col2.blue  = 56000;
-
       style1 = gtk_style_new ();
-      style1->base[GTK_STATE_NORMAL] = col1;
-      style1->fg[GTK_STATE_SELECTED] = col2;
+      style1->base[GTK_STATE_NORMAL] = green_col;
+      style1->fg[GTK_STATE_SELECTED] = purple_col;
 
       style2 = gtk_style_new ();
-      style2->base[GTK_STATE_SELECTED] = col2;
-      style2->fg[GTK_STATE_NORMAL] = col1;
-      style2->base[GTK_STATE_NORMAL] = col2;
+      style2->base[GTK_STATE_SELECTED] = purple_col;
+      style2->fg[GTK_STATE_NORMAL] = green_col;
+      style2->base[GTK_STATE_NORMAL] = purple_col;
       pango_font_description_free (style2->font_desc);
       style2->font_desc = pango_font_description_from_string ("courier 30");
     }
@@ -10448,7 +10427,7 @@ create_wmhints (GtkWidget *widget)
       gtk_widget_realize (window);
       
       circles = gdk_bitmap_create_from_data (window->window,
-                                            circles_bits,
+                                            (gchar *) circles_bits,
                                             circles_width,
                                             circles_height);
       gdk_window_set_icon (window->window, NULL,
index 7744f1246e8ff3c25a6af974a5a55e4eded6b5f8..8ee688a937fc679e5da92fe5e6eacc4f17f5ff6d 100644 (file)
@@ -1050,7 +1050,7 @@ gtk_real_model_types_get_value (GtkTreeModel *tree_model,
         
         g_value_init (value, G_TYPE_STRING);
 
-        str = g_strdup_printf ("%ld", type);
+        str = g_strdup_printf ("%ld", (long int) type);
         g_value_set_string (value, str);
         g_free (str);
       }
@@ -1249,7 +1249,9 @@ gtk_real_model_types_iter_parent (GtkTreeModel *tree_model,
   if (parent == G_TYPE_INVALID)
     {
       if (type > G_TYPE_FUNDAMENTAL_MAX)
-        g_warning ("no parent for %ld %s\n", type, g_type_name (type));
+        g_warning ("no parent for %ld %s\n",
+                   (long int) type,
+                   g_type_name (type));
       return FALSE;
     }
   else